Add Xiaomi Miio vacuum config flow#46669
Conversation
|
Hey there @rytilahti, @syssi, mind taking a look at this pull request as its been labeled with an integration ( |
|
This pull request needs to be manually signed off by @home-assistant/core before it can get merged. |
|
I haven't yet tested nor yet looked at the code, but when the manual configuration gets dropped, there needs to be a way to specify the model information if the info query fails. python-miio will currently raise a specific exception if this happens (see rytilahti/python-miio#685) and I know personally that gen1 vacuums w/o cloud connection do have this problem, but there may be other devices that behave similarly. Another use case for this is to allow supporting devices that are not yet added to the list of supported devices, but which still share (and can function) as they resemble other devices. |
|
@rytilahti I will implement an aditional dorp down to select the model if the initial info call fails. The only problem left is then that we also need the mac-adress if the info call fails.... |
|
@MartinHjelmare I think this is ready to be merged |
|
@MartinHjelmare could you revieuw again/approve? |
|
@MartinHjelmare any more suggestions? |
|
I don't currently have time to read through & give it a whirl, but having the optional model in the dialog looks good to me (and more importantly, allows myself to keep using the integration with my vacuum ;-)! If you wish, I can do some testing (and do a brief code review) at some point next week. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Looks good!
Let me know when we should merge.
|
@rytilahti I just tested this code myself and at least the config flow works. I am pretty confident that it will work. @rytilahti I think this can be merged now, if you experiance any problems during testing I can fix that in a small bugfix PR, but as I sad, I am 95% sure it will just work, Do you agree? |
|
Sounds good to me @starkillerOG, I trust you (and @MartinHjelmare) on this matter! I'll mark it down as a personal todo to convert my vacuum away from the yaml configuration, and we will simply prepare a fix if necessary. |
|
@MartinHjelmare this can be merged now |
|
I just tested the new config flow with my Roborock S5 Max and it works without any issue (I set it up by inserting the IP and the token)👍 |
|
@TheZoker thanks for testing! |
Breaking change
The Xiaomi Miio Vacuum platform now uses Config Flow, the old yaml config is imported to a Config Entry, please remove the yaml config once you see the
Loading Xiaomi Miio Vacuum via platform setup is deprecated. Please remove it from your configuration. warning in the log.Proposed change
Add config flow for the Xiaomi Miio Vacuum platform
Type of change
Example entry for
configuration.yaml:Config Flow
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: